package com.mlnx.netty.xmbp;


import com.mlnx.netty.base.handler.PushBpHandle;
import com.mlnx.netty.base.handler.PushSynBpHandle;
import com.mlnx.netty.base.handler.RegisterHandle;
import com.mlnx.netty.handler.*;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * Created by amanda.shan on 2019/10/16.
 */
public class XmBpServerInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new BpDecode());
        ch.pipeline().addLast(new BpEncode());
        ch.pipeline().addLast(new SessionCheckHandler());
        ch.pipeline().addLast(new BpServerHandler());
        ch.pipeline().addLast(new RegisterHandle());
        ch.pipeline().addLast(new PushSynBpHandle());
        ch.pipeline().addLast(new PushBpHandle());
        ch.pipeline().addLast(new XmbpCacheHandler());

    }
}
